﻿using PosClient.Model;
using ReactiveUI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reactive;
using System.Text;
using System.Threading.Tasks;

namespace PosClient.ViewModel
{
    public class ScanPayViewModel : ReactiveObject
    {
        public Pay SelectPay
        {
            get => _SelectPay;
            set => this.RaiseAndSetIfChanged(ref _SelectPay, value);
        }
        private Pay _SelectPay;

        public PayViewModel PayViewModel
        {
            get => _PayViewModel;
            set => this.RaiseAndSetIfChanged(ref _PayViewModel, value);
        }
        private PayViewModel _PayViewModel;

        public ReactiveCommand<Unit, Result<dynamic>> ConfirmPayCommand { get; }

        public ScanPayViewModel()
        {
            ConfirmPayCommand = ReactiveCommand.Create(ConfirmPayCommandImpl);

        }

        private Result<dynamic> ConfirmPayCommandImpl()
        {
            Result<dynamic> result = new Result<dynamic>
            {
                Success = true,
                Message = "付款成功"
            };

            return result;
        }
    }
}
